package restlike.demo.royalbankofshoreditch

import im.mange.shoreditch.api.liftweb.ServiceHelper
import ServiceHelper._
import im.mange.shoreditch.api._
import im.mange.shoreditch.api.liftweb.ServiceHelper

//TODO: remove the word Probe from everywhere
object Pricing extends ServiceHelper(base = "pricing", version = "10001")(
  "trade/priced/@id" check TradePriced
)

case class TradePriced(id: String) extends Check {
  override def run =
    if (DemoState.trades.exists(t => t.ref == id && t.priced)) success
    else failure(List(s"Trade $id has not been priced"))
}